/**
 * 
 */
package com.zippoy.common.authorits.services;

import com.zippoy.common.authorits.beans.SysUser;
import com.zippoy.common.authorits.beans.SysUserExample;
import com.zippoy.api.common.service.ISysUserService;
import com.zippoy.common.authorits.mappers.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;


/**
 * @author aydx84318@163.com
 *
 */
@Service
public class SysUserService implements ISysUserService {

	@Autowired
	public SysUserMapper sysUserMapper;

	@Override
	public void insert(SysUser user) {
		if(user!=null){
			user.setCreateTime(new Timestamp(System.currentTimeMillis()));
		}
		this.sysUserMapper.insert(user);
	}

	@Override
	public void getOperateByUserName(String loginName){
		SysUserExample sysUserExample=new SysUserExample();
		sysUserExample.createCriteria().andLoginNameEqualTo(loginName);
		List<SysUser> list_user=this.sysUserMapper.selectByExample(sysUserExample);
		if(list_user!=null&&list_user.size()>0){
			SysUser user=list_user.get(0);
		}
	}
}
